/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sales.hanserver.socket;

import br.com.sales.hanserver.action.hancadso.purchaserequest.GetDataRequestGridAction;
import br.com.sales.hanserver.action.hancadso.purchaserequest.InactivateRequestAction;
import br.com.sales.hanserver.action.hancadso.purchaserequest.UpdateRequester;
import br.com.sales.hanserver.action.hancadso.purchaserequest.insert.InsertNewItem;
import br.com.sales.hanserver.action.hancadso.purchaserequest.subitem.GetDataSubItemAction;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

/**
 *
 * @author v
 */
public class HanCadSOServer {

    public Map insertNewItem(Map fields) {
        return new InsertNewItem().insertRequest(fields);
    }

    public List<Map> getDateGrid(Map items) {
        return new GetDataRequestGridAction().getDataGrid(items);
    }

    public void inactivate(long sequence) {
        new InactivateRequestAction().inactivate(sequence);
    }

    public List<Map> getDataSubItem(long sequence) {
        return new GetDataSubItemAction().getDataGrid(sequence);
    }

    public void updateDateRequest( String field, Long sequence) {
        new UpdateRequester().update(new Timestamp(System.currentTimeMillis()), field, sequence);
    }
}
